Figure 15: The "Texture Editor" can be used to map images onto 3D objects. Ez3d supports a wide variety of formats, and provides powerful tools to manipulate textures
The "Texture Editor" allows you to map texture images onto your objects. A "texture" is a nothing but a bitmap image that can be wrapped around a 3D object.
Since texture mapping can be a fairly slow operation, Ez3d provides a smaller "Mapping Preview Window" that you can use to "preview" your texture map on the object, interactively translate, rotate and scale the texture on the object, and so on. And when you are satisfied with the way your texture looks, select "Update" to update the texture map of the object.
Texture Image Selector
Use the file selector to choose an image file. The image file can be in any of the supported formats (GIF, Targa, and so on).
Texture Mapping Controls
The texture editor was designed to make object texture mapping as intuitive as possible. More importantly, it was designed to give the user immediate feedback on all control inputs.
Translate X / Y
These slider is used to move the image in the X and Y directions on the surface of the object. In most cases, you will see left-right and up-down movements of the image, respectively. For more precise control, enter the value in the text field next to the slider, and press "Ok".
Rotate
This slider is used to rotate the image relative to its original position and orientation in the original texture. In most cases, you will see an angular movement of the image on the object when the "Rotate" control is used. For more precise control, enter the "Rotate" value in the text field next to the slider.
Scale X / Y
These sliders control the X and Y scale of the map on the surface of the object. This tool works in conjunction with the "Wrap Type" control. The effects of changing the X or Y scale are quite different depending on the "Wrap" being used (see "Wrap Type below). Generally, you will see the image map get larger or smaller in a horizontal direction when the this control is used. For more precise control, enter the value in the text field next to the slider.
Mirror X / Y
When you have this toggle turned on, the texture gets mirrored in the X or Y direction.
Mapping
This is a more advanced option. Ez3d offers a choice of techniques to map textures on to objects. While options like "Translate" affect the external characteristic of the texture once it has been mapped on an object, the "Mapping" type determines how the image is mapped on the object in the first place. Further, you can edit the mapping function using a 3D manipulator in the texture window, if you have the "Edit" toggle turned on. The mapping technique affects the "texture coordinates", not the transform of the texture map, and hence offers you an additional degree of freedom to get the texture displayed as you want it.
The following are the texture mapping types available in Ez3d:
Default mapping type:
This applies only to "Primitive" and "3D Text" objects, not to polygonal objects created using Potter and so on. "Default" mapping is different for different shapes, and cannot be edited any further. Here is how the "Default" texture mapping works for each of the following primitives:
Sphere: The texture covers the entire surface of the sphere, wrapping counterclockwise from the back of the sphere (from -Z axis)
Cube: The entire texture is applied to each face. On the front, back, right and left sides, the texture is applied right side up. On the top and bottom of the cube, the texture is oriented toward the +Z axis.
Cylinder/Cone: The texture wraps counterclockwise around the sides, beginning at the -Z axis. For the top/bottom of the shape, a circle cut from the center of the texture is applied.
3D Text: The texture is mapped flatly on the front (and back). On the sides, it is mapped back to front.
Parametric mapping type:
This applies to "Potter" and "Spline" objects only, where the objects are defined in terms of rectangular meshes. The texture is mapped "skin-tight" on top of the mesh, and stretches or shrinks with the geometry of the mesh. The end caps are not mapped. This mapping cannot be edited further.
The texture is mapped in the "parameter space" of the mesh. To comprehend the mapping, assume that the mesh is stretched out so that it is a flat rectangular plate. Then project the texture onto this plate, and finally put the mesh back to its original shape.
Planar, Cylindrical, Spherical mapping types:
These apply to all polygonal objects (such as those created by "Potter" or
"Face Builder".). If you want to use these mappings on Primitives or 3D Text, invoke "Face Builder" on the object to first convert them to "Faces" objects.
Planar mapping is like a film projector that casts the texture on the object along a given direction. This is a very common form of texture mapping.
Cylindrical mapping wraps the texture around an imaginary cylinder that fits the object. Only the sides are mapped, not the top and bottom caps. Also, there may be a seam at the point where the texture wraps around. It is up to you to either hide the seam away from the view point, or make the object denser in the region, so that the seam is minimized.
Spherical mapping wraps the texture around an imaginary sphere that fits the object. There will be a seam in this case also.
To edit the direction of mapping, turn on the "Edit" toggle. This brings up a 3D trackball in the viewer window. Rotate the 3D trackball until you get the direction you want (see "Options - Selection Highlight" for details on the 3D trackball). If you have "Attribute - Transform" up, you can also type in precise values for the rotation.
Environment
This option when selected maps the texture as if the object reflects the surrounding world. Hence the texture mapping changes as the view changes. Also, this works best when you use a special type of image - a spherical reflection map.
Note: Environment mapping is not available in the VRML output format.
Custom (experts only):
Sometimes you may not get the result you wanted, even if you used all combinations of mapping types and texture scaling. You can set the mapping type to "Custom", write out the object out to file, then hand-edit the texture coordinates of the object. When you read it back in, the object looks like what you want (provided you don't edit the texture map again!)
Model Type
This control is used to set the texture model to be used. It can be set to one of the following:
Modulate
The "Modulate" option multiplies the shaded color with the texture color to obtain the final color for the object.
Decal
The "Decal" option replaces the shaded color of the object with the texture color. Hence the basic color of the object is lost.
Wrap Type
The following "Wrap types" can be set:
Repeat
In "Repeat" mode, the image is mapped to the object as many times as it takes to cover the object with an equal number of duplicate maps. You can use the translate/ scale tools to fit the clamped texture map exactly the way you want.
Clamp
In "Clamp" mode, the texture image is only mapped once to the object no matter what alterations are made using the editor.
Quality
Use this slider to set the quality of the texture map. Values for this setting range from 0.0 to 1.0. Higher values for texture quality result in more realistic texture maps, but the trade-off is that they will be slower to display and render, particularly on systems that do not support hardware accelerated texture mapping.
Component
This control is used to set the component of the texture map. Component of a texture may be set to any of the following types:
Intensity
This specifies that the texture image be used to modify the shaded color of the object.
Transparency
This specifies that the texture image be used to modify the transparency of the object. Only texture images that have a single component, such as monochrome (black and white) images, can be mapped using this option.
Reflectivity
This specifies that the texture image be used to modify the reflectivity property of the object. This option affects only the final rendered image. Only texture images that have 1 component (channel) can be mapped using this option.
ShininessThis specifies that the texture image be used to modify the shininess property of the object. This option affects only the final rendered image. Only texture images that have 1 component (channel) can be mapped using this option.BumpThis specifies that the texture image be used to modify the gradient (normal) of the object. This option affects only the final rendered image. Only texture images that have 1 component (channel) can be mapped using this option. Beautiful effects of surface depressions and protrusions can be produced using this component in the final photo-real rendered image. For example, you can create an image of a rough floor by mapping a bump map representing the floor's roughness onto a flat plate.
Size
This thumb-wheel is used to set the size of the bump (see "Bump") when a single-component image is mapped to the object. If the texture component is set to bump, this value controls the size or amount of bumpiness on the object. Negative bump sizes causes depression effects on the object, while positive bump sizes causes protrusions. Use the text field on the right to enter precise values or move the thumb-wheel to the desired value.The effects of this control will only show in the final rendered image.LayerThis control is used to apply a "layer" of textures on the object. The effects of this control are visible only in the final rendered image. Only the outer-most (0 th) layer of texture of an object is visible in the main Ez3d scene. You can then apply layers of textures one after another below. These additional layers (called "inner layers") up to a maximum of 20 layers and the outer-most (0 th) layer are all overlapped one below the other in the final photo-real rendered image to produce beautiful effects of texture layers. But each layer's texture can be previewed inside the preview window of the texture editor to see exactly how it is mapped on to the object before being overlapped in the final rendered image. You will be able to go from one layer to another and have the preview window "peel off" one layer after another and show effects of the currently set layer.Note: Layered textures are more useful when wrap type is set to "clamp". It then presents a way of "stamping" many images at desired locations on the object.Hint: Here's an example of how you would use the layered texture feature. If you wanted to produce a photo-real image of a dinosaur, you would want to map a three-component RGB image representing the texture of the surface of the dinosaur onto layer 0 of the dinosaur object. And on layer 1, you could map a single-component bump map representing the dinosaur's scales. When you render this object using the photo-realistic rendering module, you will obtain a beautiful textured, bumpy dinosaur surface.
Other Texture Options
Inline
This option brings up the "Inline Texture" interface. If you enter the URL path of a remote texture image (Example: "http://www.radiance.com/~radiance/logo.gif"), Ez3d will attempt to fetch the remote image if your system is on the Internet and map it to the object. This could be particularly handy if you're creating 3-D content (VRML) for the Internet.
Texture Storage
This brings up the "Texture Storage Options" interface. You can use this interface to set the following options:
Copy to current folder
When this option is selected, Ez3d copies the texture file to the current folder.
Set path relative to current folder (recommended)
When this option is set, Ez3d will set relative path names for textures. For example, if your texture file selected is in "\users\you\pictures\monalisa.gif" and if your current project folder is "\users\you\vrml", the texture path encoded in the scene file is "..\pictures\monalisa.gif". This option is particularly useful if you're authoring 3-D (VRML) content for the Internet.
Encode in object/scene file
When this option is set, Ez3d will encode the texture information in the object or scene file at the time of saving. The original texture image is not required to texture map the object later in Ez3d or any other 3-D application. While this makes your 3-D objects and scenes more portable, do remember that this will increase the size of your model and scene files.
Auto / UpdateThe texture editor works in one of two ways. In manual mode, you must click on the "Update" button to see the texture map selection get updated in the main scene. If you have the "Auto" option turned on, you don't need to click on the "Update" button every time you want to update the main scene. Every single texture editor action updates the preview window and the main scene if the "Auto" option is on. Having this option on can make things slow.RemoveThis button when selected removes the texture map.CloseThis button when selected closes the "Texture Editor".